/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.st.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 生产工单Entity
 *
 * @author HOHD
 * @version 2020-12-19
 */
@Table(name = "st_product_bill_detail", alias = "a", columns = {
        @Column(name = "id", attrName = "id", label = "id", isPK = true),
        @Column(name = "material_name", attrName = "materialName", label = "物料名称", queryType = QueryType.LIKE),
        @Column(name = "percent_in", attrName = "percentIn", label = "占比"),
        @Column(name = "weight", attrName = "weight", label = "重量KG"),
        @Column(name = "product_type", attrName = "productType", label = "生产类型"),
        @Column(name = "weigh_place", attrName = "weighPlace", label = "称重点"),
        @Column(name = "weigh_order", attrName = "weighOrder", label = "称重顺序"),
        @Column(name = "exist_stock_number", attrName = "existStockNumber", label = "现有库存量"),
        @Column(name = "parent_id", attrName = "parentId.id", label = "父 id"),
}, orderBy = "a.id ASC"
)
public class StProductBillDetail extends DataEntity<StProductBillDetail> {

    private static final long serialVersionUID = 1L;
    private String materialName;        // 物料名称
    private BigDecimal percentIn;        // 占比
    private BigDecimal weight;        // 重量KG
    private String productType;        // 生产类型
    private Integer weighPlace;        // 称重点
    private Integer weighOrder;        // 称重顺序
    private BigDecimal existStockNumber;        // 现有库存量
    private StProductBill parentId;        // 父 id 父类
    private StProductRecord productRecord;

    private StFormulaName formulaName;
    private StMaterialRecord materialRecord;

    private String weighPlaceName;
    private String materialCategory;//物料分类
    private String barCode;
    private String batchNumber;
    private String supplierFullName;

    private Date productDate;

    private Integer savedType;

    private BigDecimal theoryNumber;

    public StProductRecord getProductRecord() {
        return productRecord;
    }

    public void setProductRecord(StProductRecord productRecord) {
        this.productRecord = productRecord;
    }

    public StFormulaName getFormulaName() {
        return formulaName;
    }

    public void setFormulaName(StFormulaName formulaName) {
        this.formulaName = formulaName;
    }

    public StMaterialRecord getMaterialRecord() {
        return materialRecord;
    }

    public void setMaterialRecord(StMaterialRecord materialRecord) {
        this.materialRecord = materialRecord;
    }

    public String getWeighPlaceName() {
        return weighPlaceName;
    }

    public void setWeighPlaceName(String weighPlaceName) {
        this.weighPlaceName = weighPlaceName;
    }

    public String getMaterialCategory() {
        return materialCategory;
    }

    public void setMaterialCategory(String materialCategory) {
        this.materialCategory = materialCategory;
    }

    public String getBarCode() {
        return barCode;
    }

    public void setBarCode(String barCode) {
        this.barCode = barCode;
    }

    public String getBatchNumber() {
        return batchNumber;
    }

    public void setBatchNumber(String batchNumber) {
        this.batchNumber = batchNumber;
    }

    public String getSupplierFullName() {
        return supplierFullName;
    }

    public void setSupplierFullName(String supplierFullName) {
        this.supplierFullName = supplierFullName;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public Date getProductDate() {
        return productDate;
    }

    public void setProductDate(Date productDate) {
        this.productDate = productDate;
    }

    public Integer getSavedType() {
        return savedType;
    }

    public void setSavedType(Integer savedType) {
        this.savedType = savedType;
    }

    public BigDecimal getTheoryNumber() {
        return theoryNumber;
    }

    public void setTheoryNumber(BigDecimal theoryNumber) {
        this.theoryNumber = theoryNumber;
    }

    public StProductBillDetail() {
        this(null);
    }

    public void percentNe(Integer percent) {
        sqlMap.getWhere().and("percent_in", QueryType.NE, percent);
    }

    public StProductBillDetail(StProductBill parentId) {
        this.parentId = parentId;
    }

    @Length(min = 0, max = 36, message = "物料名称长度不能超过 36 个字符")
    public String getMaterialName() {
        return materialName;
    }

    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }

    public BigDecimal getPercentIn() {
        return percentIn;
    }

    public void setPercentIn(BigDecimal percentIn) {
        this.percentIn = percentIn;
    }

    public BigDecimal getWeight() {
        return weight;
    }

    public void setWeight(BigDecimal weight) {
        this.weight = weight;
    }

    @Length(min = 0, max = 8, message = "生产类型长度不能超过 8 个字符")
    public String getProductType() {
        return productType;
    }

    public void setProductType(String productType) {
        this.productType = productType;
    }

    public Integer getWeighPlace() {
        return weighPlace;
    }

    public void setWeighPlace(Integer weighPlace) {
        this.weighPlace = weighPlace;
    }

    public Integer getWeighOrder() {
        return weighOrder;
    }

    public void setWeighOrder(Integer weighOrder) {
        this.weighOrder = weighOrder;
    }

    public BigDecimal getExistStockNumber() {
        return existStockNumber;
    }

    public void setExistStockNumber(BigDecimal existStockNumber) {
        this.existStockNumber = existStockNumber;
    }

    @Length(min = 0, max = 36, message = "父 id长度不能超过 36 个字符")
    public StProductBill getParentId() {
        return parentId;
    }

    public void setParentId(StProductBill parentId) {
        this.parentId = parentId;
    }

}